.class public Lcom/hierynomus/smbj/smb2/messages/h;
.super Lcom/hierynomus/smbj/smb2/d;
.source "SMB2NegotiateRequest.java"


# instance fields
.field private c:Ljava/util/EnumSet;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/EnumSet<",
            "Lcom/hierynomus/smbj/smb2/SMB2Dialect;",
            ">;"
        }
    .end annotation
.end field

.field private d:Ljava/util/UUID;


# direct methods
.method public constructor <init>(Ljava/util/EnumSet;Ljava/util/UUID;)V
    .locals 8
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/EnumSet<",
            "Lcom/hierynomus/smbj/smb2/SMB2Dialect;",
            ">;",
            "Ljava/util/UUID;",
            ")V"
        }
    .end annotation

    .line 1
    sget-object v2, Lcom/hierynomus/smbj/smb2/SMB2Dialect;->UNKNOWN:Lcom/hierynomus/smbj/smb2/SMB2Dialect;

    sget-object v3, Lcom/hierynomus/smbj/smb2/SMB2MessageCommandCode;->SMB2_NEGOTIATE:Lcom/hierynomus/smbj/smb2/SMB2MessageCommandCode;

    const/16 v1, 0x24

    const-wide/16 v4, 0x0

    const-wide/16 v6, 0x0

    move-object v0, p0

    invoke-direct/range {v0 .. v7}, Lcom/hierynomus/smbj/smb2/d;-><init>(ILcom/hierynomus/smbj/smb2/SMB2Dialect;Lcom/hierynomus/smbj/smb2/SMB2MessageCommandCode;JJ)V

    .line 2
    iget-object v0, p0, Lcom/hierynomus/smbj/smb2/d;->a:Lcom/hierynomus/smbj/smb2/c;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/hierynomus/smbj/smb2/c;->a(I)V

    .line 3
    iput-object p1, p0, Lcom/hierynomus/smbj/smb2/messages/h;->c:Ljava/util/EnumSet;

    .line 4
    iput-object p2, p0, Lcom/hierynomus/smbj/smb2/messages/h;->d:Ljava/util/UUID;

    return-void
.end method

.method private c()V
    .locals 2

    .line 1
    iget-object v0, p0, Lcom/hierynomus/smbj/smb2/messages/h;->c:Ljava/util/EnumSet;

    sget-object v1, Lcom/hierynomus/smbj/smb2/SMB2Dialect;->SMB_3_1_1:Lcom/hierynomus/smbj/smb2/SMB2Dialect;

    invoke-virtual {v0, v1}, Ljava/util/EnumSet;->contains(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    return-void

    .line 2
    :cond_0
    new-instance v0, Ljava/lang/UnsupportedOperationException;

    const-string v1, "SMB 3.x support is not yet implemented"

    invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method private e(Lcom/hierynomus/smbj/common/b;)V
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/hierynomus/smbj/smb2/messages/h;->c:Ljava/util/EnumSet;

    invoke-static {v0}, Lcom/hierynomus/smbj/smb2/SMB2Dialect;->supportsSmb3x(Ljava/util/EnumSet;)Z

    move-result v0

    if-nez v0, :cond_0

    .line 2
    invoke-virtual {p1}, Lcom/hierynomus/smbj/common/b;->n()Lcom/hierynomus/protocol/commons/buffer/Buffer;

    return-void

    .line 3
    :cond_0
    new-instance p1, Ljava/lang/UnsupportedOperationException;

    const-string v0, "SMB 3.x support is not yet implemented"

    invoke-direct {p1, v0}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw p1
.end method

.method private f(Lcom/hierynomus/smbj/common/b;)V
    .locals 2

    .line 1
    iget-object v0, p0, Lcom/hierynomus/smbj/smb2/messages/h;->c:Ljava/util/EnumSet;

    invoke-virtual {v0}, Ljava/util/EnumSet;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/hierynomus/smbj/smb2/SMB2Dialect;

    .line 2
    invoke-virtual {v1}, Lcom/hierynomus/smbj/smb2/SMB2Dialect;->getValue()I

    move-result v1

    invoke-virtual {p1, v1}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c(I)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    goto :goto_0

    :cond_0
    return-void
.end method

.method private g(Lcom/hierynomus/smbj/common/b;)V
    .locals 2

    .line 1
    iget-object v0, p0, Lcom/hierynomus/smbj/smb2/messages/h;->c:Ljava/util/EnumSet;

    sget-object v1, Lcom/hierynomus/smbj/smb2/SMB2Dialect;->SMB_3_1_1:Lcom/hierynomus/smbj/smb2/SMB2Dialect;

    invoke-virtual {v0, v1}, Ljava/util/EnumSet;->contains(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    .line 2
    invoke-virtual {p1}, Lcom/hierynomus/smbj/common/b;->n()Lcom/hierynomus/protocol/commons/buffer/Buffer;

    .line 3
    invoke-virtual {p1}, Lcom/hierynomus/smbj/common/b;->n()Lcom/hierynomus/protocol/commons/buffer/Buffer;

    return-void

    .line 4
    :cond_0
    new-instance p1, Ljava/lang/UnsupportedOperationException;

    const-string v0, "SMB 3.x support is not yet implemented"

    invoke-direct {p1, v0}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw p1
.end method


# virtual methods
.method protected d(Lcom/hierynomus/smbj/common/b;)V
    .locals 2

    .line 1
    iget v0, p0, Lcom/hierynomus/smbj/smb2/d;->b:I

    invoke-virtual {p1, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c(I)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    .line 2
    iget-object v0, p0, Lcom/hierynomus/smbj/smb2/messages/h;->c:Ljava/util/EnumSet;

    invoke-virtual {v0}, Ljava/util/EnumSet;->size()I

    move-result v0

    invoke-virtual {p1, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c(I)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    const/4 v0, 0x1

    .line 3
    invoke-virtual {p1, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c(I)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    const/4 v0, 0x2

    .line 4
    invoke-virtual {p1, v0}, Lcom/hierynomus/smbj/common/b;->i(I)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    .line 5
    invoke-direct {p0, p1}, Lcom/hierynomus/smbj/smb2/messages/h;->e(Lcom/hierynomus/smbj/common/b;)V

    .line 6
    iget-object v1, p0, Lcom/hierynomus/smbj/smb2/messages/h;->d:Ljava/util/UUID;

    invoke-static {v1, p1}, Lcom/hierynomus/msdtyp/a;->a(Ljava/util/UUID;Lcom/hierynomus/protocol/commons/buffer/Buffer;)V

    .line 7
    invoke-direct {p0, p1}, Lcom/hierynomus/smbj/smb2/messages/h;->g(Lcom/hierynomus/smbj/common/b;)V

    .line 8
    invoke-direct {p0, p1}, Lcom/hierynomus/smbj/smb2/messages/h;->f(Lcom/hierynomus/smbj/common/b;)V

    .line 9
    iget-object v1, p0, Lcom/hierynomus/smbj/smb2/messages/h;->c:Ljava/util/EnumSet;

    invoke-virtual {v1}, Ljava/util/EnumSet;->size()I

    move-result v1

    mul-int/lit8 v1, v1, 0x2

    add-int/lit8 v1, v1, 0x22

    rem-int/lit8 v1, v1, 0x8

    if-lez v1, :cond_0

    rsub-int/lit8 v0, v1, 0x8

    .line 10
    invoke-virtual {p1, v0}, Lcom/hierynomus/smbj/common/b;->i(I)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    .line 11
    :cond_0
    invoke-direct {p0}, Lcom/hierynomus/smbj/smb2/messages/h;->c()V

    return-void
.end method
